package com.huangliusong.dubbo;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

/**
 * @author huangliusong
 * @since 2019/1/1
 * {@link }
 */
public class ConsumerClient {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("applicationContext-consumer.xml");
        context.start();


        while (true){
            Scanner scanner=new Scanner(System.in);
            String message=scanner.next();
            ServiceAPI serviceAPI=(ServiceAPI)context.getBean("consumer");
            System.out.println(serviceAPI.sendMessage(message));

        }
    }
}
